<?php
if($user['user_type'] == 1) {
    $sql = 'SELECT * FROM '.FDB::table('wogu_user_shop').' WHERE uid='.$user['uid'];
    $shopinfo = FDB::fetchFirst($sql);

    // 好评、中评、差评
    $sql = 'SELECT COUNT(*) AS num FROM '.FDB::table('wogu_order').' WHERE shopid='.$user['uid'] . ' AND flag=2 AND grade=0';
    $r = FDB::fetchFirst($sql);
    $num_hao = $r['num'];
    $sql = 'SELECT COUNT(*) AS num FROM '.FDB::table('wogu_order').' WHERE shopid='.$user['uid'] . ' AND flag=2 AND grade=1';
    $r = FDB::fetchFirst($sql);
    $num_zhong = $r['num'];
    $sql = 'SELECT COUNT(*) AS num FROM '.FDB::table('wogu_order').' WHERE shopid='.$user['uid'] . ' AND flag=2 AND grade=2';
    $r = FDB::fetchFirst($sql);
    $num_cha = $r['num'];
}
?>

<div class="tip_info">
    <span class="tipvip">
        <img width="61" height="61" src="{avatar $user['avatar'] m}"/>
    </span>
	<div class="info">
		<p><a class="uname" href="{$user['url']}">{$user['user_name']}</a></p>
		<p>{$user['city']}</p>
		<!-- <p>
		    关注：<a target="_blank" href="{u u/follow uid=$user['uid']}"><span>{$user['follows']}</span></a>
		    粉丝：<a target="_blank" href="{u u/fans uid=$user['uid']}"><span>{$user['fans']}</span></a>
		    微博：{$user['collects']}
		</p> -->
	</div>
    <div style="clear: both;"></div>
    <div style="padding: 5px 10px;">
        {if $user['user_type'] == 1}
        <p>
            <span title="已缴纳{$shopinfo['bzj']}元保证金">保证金：<span style="color: {if $shopinfo['bzj']==1000}green{elseif $shopinfo['bzj']>=3000}#FFCC00{else}#000{/if};font-weight: bold;">{$shopinfo['bzj']}元</span></span><br/>
            <table width="180">
                <tr style="background-color: #CCCCCC;">
                    <td align="center" style="color: #fff;">好评</td>
                    <td align="center" style="color: #fff;">差评</td>
                </tr>
                <tr>
                    <td align="center"><a href="/article.php?action=comments&uid={$user['uid']}&type=0" style="color:red;">{$num_hao}</a></td>
                    <td align="center"><a href="/article.php?action=comments&uid={$user['uid']}&type=2" style="color:red;">{$num_cha}</a></td>
                </tr>
            </table>
        </p>
        {/if}
    </div>
	{if $user['user_type'] == 0}
	<!--{if !empty($user['introduce'])}-->
	<div class="intro">{$user['introduce']}</div>
	<!--{else}-->
	<div class="intro"><span>真懒啊，连自我介绍都不写。</span></div>
	<!--{/if}-->
	{/if}
    <!--{if $user['v2'] > 0}-->
    <?php $medal = $_FANWE['cache']['medals']['all'][$user['v2']]; ?>
	<div class="medal_a">
		<img src="{$medal['small_img']}" height="25" alt="{$medal['desc']}" title="{$medal['desc']}">
	</div>
	<!--{/if}-->
</div>
<div class="tip_toolbar">
&nbsp;
<div class="blank3"></div>
</div>
<div class="tip_arrow"></div>